import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "/",
    name: "Login",
    component: () => import("@/views/Login.vue"),
  },
  {
    path: "/index",
    name: "index",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Index.vue"),
    children: [
      {
        path: "/user",
        name: "user",
        component: () => import("@/views/User"),
      },
      {
        path: "/course",
        name: "course",
        component: () => import("@/views/Course"),
      },
      {
        path: "/coach",
        name: "coach",
        component: () => import("@/views/Coach"),
      },
      {
        path: "/health",
        name: "health",
        component: () => import("@/views/Health"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
